package studio.banner.reference.service;

import com.baomidou.mybatisplus.extension.service.IService;
import studio.banner.reference.entity.Aggregate;

import java.util.List;

/**
 * @ClassName AggregateService
 * @Deacription TODO
 * @Author Baofeng.Wu
 * @Date 2019/10/30 19:58
 **/
public interface AggregateService extends IService<Aggregate> {
    /**
     * 插入一个文献集
     *
     * @param aggregate
     * @return
     */
    boolean insertAggregate(Aggregate aggregate);

    /**
     * 修改文献集标题
     *
     * @param aggregateTitle
     * @param aggregateId
     * @return
     */
    boolean updateAggregateTitle(String aggregateTitle, Integer aggregateId);


    /**
     * size+subtractSize
     *
     * @param id
     * @param updateSize
     */
    void updateSize(Integer id, Integer updateSize);

    /**
     * 查找文献集，通过用户Id
     *
     * @param userId
     * @return
     */
    List<Aggregate> listAggregatesByUserId(Integer userId);

    /**
     * 查找文献集，通过关键词
     *
     * @param keyword
     * @param userId
     * @return
     */
    List<Aggregate> listAggregatesByAggregateTitle(String keyword, Integer userId);


    /**
     * 查找文献集，通过文献类型
     *
     * @param aggregateType
     * @param userId
     * @return
     */
    List<Aggregate> listByAggregateType(String aggregateType, Integer userId);
}
